<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let p = new Promise((resolve, reject) => {
            // 三种修改PromiseState状态的方式
            // 1.resolve函数
            resolve('Ok')//pending==> fullfilled/resolve ==>成功
            // 2.reject函数
            reject('Ok')//pending==> reject ==>失败
            // 3.手动抛出错误 使用thorw关键字 pending==> reject ==>失败
            throw '未知错误'
        })
    </script>
</body>

</html>